public class test05 {
    /*
// Definition for a Node.
class Node {
    public int val;
    public List<Node> children;

    public Node() {}

    public Node(int _val) {
        val = _val;
    }

    public Node(int _val, List<Node> _children) {
        val = _val;
        children = _children;
    }
};
*/
        public int maxDepth(Node root) {
            int res = 0;
            if(root==null){
                return 0;
            }
            for(int i = 0;i<root.children.size();i++){
                Node tmp = root.children.get(i);
                res = Math.max(res,maxDepth(tmp));
            }
            return res+1;
        }
}
